    classification classify(int64_t num) {
        if (num <= 0) {
            return classification::deficient;
        }

        int64_t aliquot_sum = 0;
        for (int64_t i = 1; i * i <= num; ++i) {
            if (num % i == 0) {
                if (i != num) {
                    aliquot_sum += i;
                }
                int64_t other = num / i;
                if (other != i && other != num) {
                    aliquot_sum += other;
                }
            }
        }

        if (aliquot_sum == num) {
            return classification::perfect;
        } else if (aliquot_sum > num) {
            return classification::abundant;
        } else {
            return classification::deficient;
        }
    }
